package com.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.entity.User;
import com.example.mapper.UserMapper;
import com.example.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 *  服务实现类
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Override
    public User login(String account, String pass) {
        User user = this.baseMapper.selectOne(new QueryWrapper<User>().eq("account", account));
        if (user != null && user.getPassword().equals(pass)) {
            return user;
        }
        return null;
    }
}
